<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<html>
<head>
	<script type="text/javascript" src="scripts/boot.js"></script>
</head>
<body>
	<form id="form1" method="post">
        <div style="padding-left:70px;padding-bottom:5px;padding-top: 25px;">
            <table style="table-layout:fixed;">
            	<tr>
                   	<td style="width: 200px;">
                   		<input id="file_upload" name="file_upload" type="file" >
                   	</td>
                </tr>
            </table>
        </div>
        <div style="text-align:center;padding:40px;">               
            <a class="mini-button" onclick="onOk" style="width:60px;margin-right:50px;">确定</a>       
            <a class="mini-button" onclick="onCancel" style="width:60px;">取消</a>       
        </div>        
    </form>
</body>
</html>

<script type="text/javascript">
	mini.parse();
	
    $(function(){
    	setTimeout(function(){
	    	$('#file_upload').uploadify({
	    		'auto': false,
	    		'swf':'scripts/uploadify/uploadify.swf',
	    		'uploader':'sms_import_save.do;jsessionid=<%=session.getId()%>',
	    		'fileSizeLimit':'5MB',
	    		'fileTypeExts':'*.xls',
	    		'fileTypeDesc':'xls',
	    		'buttonText':'选择文件',
	    		'queueSizeLimit':1,
	    		'onUploadSuccess':function(file, data, response){
	    			data = eval('(' + data + ')');
	    			 if(data.success == true) {
	 	            	window.CloseOwnerWindow("succ");
	 	            } else {
	 	            	window.CloseOwnerWindow(data.success);
	 	            }
	    		}
	    	});
    	}, 5);
    });

    function CloseWindow(action) {            
        if (window.CloseOwnerWindow) return window.CloseOwnerWindow(action);
        else window.close();            
    }
    
    function onOk(e) {
    	$("#file_upload").uploadify('upload', '*');
    }
    
    function onCancel(e) {
    	CloseWindow("cancel");
    }
</script>